<template>
  <div class="VonDoubleInput">
    <div class="label" v-if="label">{{label}}</div>
    <el-input
            :placeholder="start_placeholder"
            oninput="value=value.replace(/[^\d]/g,'')"
            :style="customStyle"
            v-bind="$attrs"
            v-on="$listeners"
            size="small"
            clearable>
    </el-input>
    <span class="rangeTag">--</span>
    <el-input
            :placeholder="end_placeholder"
            oninput="value=value.replace(/[^\d]/g,'')"
            :style="customStyle"
            v-bind="$attrs"
            v-on="$listeners"
            size="small"
            clearable>
    </el-input>
  </div>
</template>

<script>
  export default {
    name: "VonDoubleInput",
    data() {
      return {

      }
    },
    props: {
      append:{
        type:String,
        default:''
      },
      isNumberInput:{
        type: Boolean,
        default: false
      },
      start_placeholder: {
        type: String,
        default: ''
      },
      end_placeholder: {
        type: String,
        default: ''
      },
      width: {
        type: String,
        default: '300px'
      },
      height: {
        type: String,
        default: '44px'
      },
      label: {
        type: String,
        default: ''
      }
    },
    computed: {
      customStyle() {
        let styleObj = {};
        styleObj.width = this.width;
        styleObj.height = this.height;
        styleObj.lineHeight = this.height;
        return styleObj;
      }
    },
    methods:{
    }
  }
</script>

<style lang="scss">
  @import "../../style/various";

  .VonDoubleInput {
    margin: 10px 10px;
    width: 100%;

    .label {
      height: 20px;
      line-height: 20px;
      color: white;
      font-size: 16px;
    }
    .rangeTag{
        color: white;
        margin: 2px;
    }
    .el-input {
      .el-input__inner {
        color: white !important;
        background: rgba(111, 117, 131, 0.3);
        padding: 0 4px;
        color: #1acc8f;
      }
    }
  }
</style>